From b1b322eb8b57b4a0f797fab3a533bddc60d782b4 Mon Sep 17 00:00:00 2001 From: Steven Hand Date: Tue, 26 Jun 2007 12:40:37 +0100 Subject: [PATCH] Deinitialize timers before destroying the local apic; this protects us against a late firing timer callback function (e.g. hpet_timer_fn) which tries to access local APIC state. Signed-off-by: Steven Hand --- xen/arch/x86/hvm/hvm.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c index 570181e523..2d730f6682 100644 --- a/xen/arch/x86/hvm/hvm.c +++ b/xen/arch/x86/hvm/hvm.c @@ -423,12 +423,6 @@ void hvm_vcpu_destroy(struct vcpu *v) { struct domain *d = v->domain; - vlapic_destroy(v); - hvm_funcs.vcpu_destroy(v); - - /* Event channel is already freed by evtchn_destroy(). */ - /*free_xen_event_channel(v, v->arch.hvm_vcpu.xen_port);*/ - if ( v->vcpu_id == 0 ) { /* NB. All these really belong in hvm_domain_destroy(). */ @@ -437,6 +431,12 @@ void hvm_vcpu_destroy(struct vcpu *v) pmtimer_deinit(d); hpet_deinit(d); } + + vlapic_destroy(v); + hvm_funcs.vcpu_destroy(v); + + /* Event channel is already freed by evtchn_destroy(). */ + /*free_xen_event_channel(v, v->arch.hvm_vcpu.xen_port);*/ } -- 2.30.2